package org.platform.executor.diagnose;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.mc.mic.core.bus.provider.IMicProviderServiceExecutor;
import lombok.extern.slf4j.Slf4j;
import org.platform.mo.csmo.cmd41007.QueryTestDiagnoseResultRequestParam;
import org.platform.mo.csmo.cmd41007.QueryTestDiagnoseResultResponseParam;
import org.platform.service.diagnose.DiagnoseRecordServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author FengJie
 * @date 2018/7/23
 */
@Slf4j
@Service
public class QueryTestDiagnoseResultExecutor implements IMicProviderServiceExecutor<QueryTestDiagnoseResultRequestParam, QueryTestDiagnoseResultResponseParam> {
    @Autowired
    private DiagnoseRecordServiceImpl service;

    @Override
    public QueryTestDiagnoseResultResponseParam doExecute(QueryTestDiagnoseResultRequestParam requestParam) {
        try {
            return service.queryTestDiagnoseResult(requestParam);
        } catch (JsonProcessingException e) {
            log.error("查询诊断结果错误,异常信息:", e);
            throw new RuntimeException(e);
        }
    }

}
